<template>
  <div class="stats-panel">
    <h2>Training Statistics</h2>
    
    <div class="stats-grid">
      <div class="stat-card">
        <div class="stat-value">{{ store.step }}</div>
        <div class="stat-label">Current Step</div>
      </div>
      
      <div class="stat-card">
        <div class="stat-value">{{ store.activeReplicaGroups.length }}</div>
        <div class="stat-label">Active Replica Groups</div>
      </div>
      
      <div class="stat-card">
        <div class="stat-value">{{ store.activeServers.length }}</div>
        <div class="stat-label">Active Servers</div>
      </div>
      
      <div class="stat-card">
        <div class="stat-value">{{ store.activeGPUs.length }}</div>
        <div class="stat-label">Active GPUs</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useTrainingStore } from '../stores/training'

const store = useTrainingStore()
</script>

<style scoped>
.stats-panel {
  padding: 15px;
}

h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #333;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background-color: white;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1890ff;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
}
</style>